import { get, getBlob } from '@/utils/http';
import {
  GetListFillTaskResult,
  GetListActiveDataParams,
  GetListActiveDataResult
} from './model/detailModel';

enum Api {
  // 活动数据查询条件获取
  GET_LIST_FILL_TASK = '/inventory/carbonData/listFillTask',
  // 活动数据明细
  GET_LIST_ACTIVE_DATA = '/inventory/carbonData/listActivityData',
  // 碳排放活动数据导出
  EXPORT_ACTIVE_DATA = '/inventory/carbonData/exportActivityData'
}

/**
 * 活动数据查询条件获取
 * @returns
 */
export const getListFillTask = (): Promise<GetListFillTaskResult[]> => get(Api.GET_LIST_FILL_TASK);

// 活动数据明细
export const getListActiveData = (
  params: GetListActiveDataParams
): Promise<GetListActiveDataResult[]> => get(Api.GET_LIST_ACTIVE_DATA, params);

// 活动数据导出
export const exportActiveData = (params: GetListActiveDataParams) =>
  getBlob(Api.EXPORT_ACTIVE_DATA, params);
